package com.dafeng;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 34255
 * Date: 2024-06-12
 * Time: 16:52
 */
sealed public class Animal permits Dog,Cat{
    public String name;
    public int age;

    public void sleep(){
        System.out.println(this.name + "正在睡觉!");
    }

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }
}
